-
-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(model): Unavailable guild must always have unavailable as true #2361
Conversation
Unavailable(UnavailableGuild), | ||
Available(Guild), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the ordering intentionally changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, as a available guild can't be parsed as a unavailable guild anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so here, the ordering of the enum is semantically significant? does serde try to deserialize each variant in order?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes serde will try them in order when it is untagged.
This adds a new construct that can be used to only deserialize a specific boolean value. We then use that value to ensure that only guilds which are actually unavailable get deserialized as such.
8ec9aec
to
3f417fe
Compare
Signed-off-by: Jens Reidel <[email protected]>
Signed-off-by: Jens Reidel <[email protected]>
Signed-off-by: Jens Reidel <[email protected]>
Signed-off-by: Jens Reidel <[email protected]>
This adds a new construct that can be used to only deserialize a
specific boolean value. We then use that value to ensure that only
guilds which are actually unavailable get deserialized as such.